alert('SceneScene1.js loaded');
//GESTION TEXT ////
var _count = "";
var compteur= ""; // Compteur ligne 
var scene = ""; // Nom de la scene initiatrice 
var CurrentScene ="";
var IdScene ="";
var PosDialButton;

var  answer = 1;

function SceneScene1() {
	
};

SceneScene1.prototype.initialize = function () {
	alert("SceneScene1.initialize()");
	// this function will be called only once when the scene manager show this scene first time
	// initialize the scene controls and styles, and initialize your variables here
	// scene HTML and CSS will be loaded before this function is called

	sf.scene.show('ToolBar');

};

SceneScene1.prototype.handleShow = function (data) {
	alert("SceneScene1.handleShow()");
	// this function will be called when the scene manager show this scene
	IdScene ="1";
	CurrentScene ="Scene1";
	SceneReset(CurrentScene,-1);
};

SceneScene1.prototype.handleHide = function () {
	alert("SceneScene1.handleHide()");
	// this function will be called when the scene manager hide this scene
	scene = "";
};

SceneScene1.prototype.handleFocus = function () {
	alert("SceneScene1.handleFocus()");
	// this function will be called when the scene manager focus this scene
};

SceneScene1.prototype.handleBlur = function () {
	alert("SceneScene1.handleBlur()");
	// this function will be called when the scene manager move focus to another scene from this scene
};



SceneScene1.prototype.handleKeyDown = function (keyCode) {
	alert("SceneScene1.handleKeyDown(" + keyCode + ")");
	// TODO : write an key event handler when this scene get focued
	switch (keyCode) {
		case sf.key.LEFT:
			break;
		case sf.key.RIGHT:
			break;
		case sf.key.UP:
			if(AddButton == true){

					
					PosDialButton = (PosDialButton+1)%NbButton;
					FocusCssButton(PosDialButton,-1);

			}
			
			/*$('#button1').hasClass('active')) {
                $('#button1').removeClass('active');
                $('#button2').addClass('active');
            */
			
			break;
		case sf.key.DOWN:
			if(AddButton == true){

				PosDialButton = (PosDialButton+1)%NbButton;
				FocusCssButton(PosDialButton,1);
		}

			break;
		case sf.key.ENTER:
			Enter();
			break;
		case sf.key.RETURN:
			event.preventDefault();
			sf.scene.hide('Scene1');
			sf.scene.show('Menu');
			sf.scene.focus('Menu');
			break;
		default:
			alert("handle default key event, key code(" + keyCode + ")");
			break;
	}
};
